// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

#include <PyIndexSelectAttributes.h>
#include <ObserverToCallback.h>
#include <stdio.h>
#include <Py2and3Support.h>

// ****************************************************************************
// Module: PyIndexSelectAttributes
//
// Purpose:
//   This class contains attributes for the index select operator.
//
// Note:       Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation:   omitted
//
// ****************************************************************************

//
// This struct contains the Python type information and a IndexSelectAttributes.
//
struct IndexSelectAttributesObject
{
    PyObject_HEAD
    IndexSelectAttributes *data;
    bool        owns;
    PyObject   *parent;
};

//
// Internal prototypes
//
static PyObject *NewIndexSelectAttributes(int);
std::string
PyIndexSelectAttributes_ToString(const IndexSelectAttributes *atts, const char *prefix, const bool forLogging)
{
    std::string str;
    char tmpStr[1000];

    const char *maxDim_names = "OneD, TwoD, ThreeD";
    switch (atts->GetMaxDim())
    {
      case IndexSelectAttributes::OneD:
          snprintf(tmpStr, 1000, "%smaxDim = %sOneD  # %s\n", prefix, prefix, maxDim_names);
          str += tmpStr;
          break;
      case IndexSelectAttributes::TwoD:
          snprintf(tmpStr, 1000, "%smaxDim = %sTwoD  # %s\n", prefix, prefix, maxDim_names);
          str += tmpStr;
          break;
      case IndexSelectAttributes::ThreeD:
          snprintf(tmpStr, 1000, "%smaxDim = %sThreeD  # %s\n", prefix, prefix, maxDim_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    const char *dim_names = "OneD, TwoD, ThreeD";
    switch (atts->GetDim())
    {
      case IndexSelectAttributes::OneD:
          snprintf(tmpStr, 1000, "%sdim = %sOneD  # %s\n", prefix, prefix, dim_names);
          str += tmpStr;
          break;
      case IndexSelectAttributes::TwoD:
          snprintf(tmpStr, 1000, "%sdim = %sTwoD  # %s\n", prefix, prefix, dim_names);
          str += tmpStr;
          break;
      case IndexSelectAttributes::ThreeD:
          snprintf(tmpStr, 1000, "%sdim = %sThreeD  # %s\n", prefix, prefix, dim_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    snprintf(tmpStr, 1000, "%sxAbsMax = %d\n", prefix, atts->GetXAbsMax());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sxMin = %d\n", prefix, atts->GetXMin());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sxMax = %d\n", prefix, atts->GetXMax());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sxIncr = %d\n", prefix, atts->GetXIncr());
    str += tmpStr;
    if(atts->GetXWrap())
        snprintf(tmpStr, 1000, "%sxWrap = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sxWrap = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%syAbsMax = %d\n", prefix, atts->GetYAbsMax());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%syMin = %d\n", prefix, atts->GetYMin());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%syMax = %d\n", prefix, atts->GetYMax());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%syIncr = %d\n", prefix, atts->GetYIncr());
    str += tmpStr;
    if(atts->GetYWrap())
        snprintf(tmpStr, 1000, "%syWrap = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%syWrap = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%szAbsMax = %d\n", prefix, atts->GetZAbsMax());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%szMin = %d\n", prefix, atts->GetZMin());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%szMax = %d\n", prefix, atts->GetZMax());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%szIncr = %d\n", prefix, atts->GetZIncr());
    str += tmpStr;
    if(atts->GetZWrap())
        snprintf(tmpStr, 1000, "%szWrap = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%szWrap = 0\n", prefix);
    str += tmpStr;
    if(atts->GetUseWholeCollection())
        snprintf(tmpStr, 1000, "%suseWholeCollection = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%suseWholeCollection = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%scategoryName = \"%s\"\n", prefix, atts->GetCategoryName().c_str());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%ssubsetName = \"%s\"\n", prefix, atts->GetSubsetName().c_str());
    str += tmpStr;
    return str;
}

static PyObject *
IndexSelectAttributes_Notify(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    obj->data->Notify();
    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_SetMaxDim(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid maxDim value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " OneD";
        ss << ", TwoD";
        ss << ", ThreeD";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the maxDim in the object.
    obj->data->SetMaxDim(IndexSelectAttributes::Dimension(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetMaxDim(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetMaxDim()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetDim(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid dim value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " OneD";
        ss << ", TwoD";
        ss << ", ThreeD";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the dim in the object.
    obj->data->SetDim(IndexSelectAttributes::Dimension(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetDim(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetDim()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetXAbsMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the xAbsMax in the object.
    obj->data->SetXAbsMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetXAbsMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetXAbsMax()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetXMin(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the xMin in the object.
    obj->data->SetXMin(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetXMin(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetXMin()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetXMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the xMax in the object.
    obj->data->SetXMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetXMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetXMax()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetXIncr(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the xIncr in the object.
    obj->data->SetXIncr(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetXIncr(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetXIncr()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetXWrap(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the xWrap in the object.
    obj->data->SetXWrap(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetXWrap(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetXWrap()?1L:0L);
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetYAbsMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the yAbsMax in the object.
    obj->data->SetYAbsMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetYAbsMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetYAbsMax()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetYMin(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the yMin in the object.
    obj->data->SetYMin(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetYMin(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetYMin()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetYMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the yMax in the object.
    obj->data->SetYMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetYMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetYMax()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetYIncr(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the yIncr in the object.
    obj->data->SetYIncr(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetYIncr(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetYIncr()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetYWrap(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the yWrap in the object.
    obj->data->SetYWrap(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetYWrap(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetYWrap()?1L:0L);
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetZAbsMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the zAbsMax in the object.
    obj->data->SetZAbsMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetZAbsMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetZAbsMax()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetZMin(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the zMin in the object.
    obj->data->SetZMin(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetZMin(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetZMin()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetZMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the zMax in the object.
    obj->data->SetZMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetZMax(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetZMax()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetZIncr(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the zIncr in the object.
    obj->data->SetZIncr(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetZIncr(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetZIncr()));
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetZWrap(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the zWrap in the object.
    obj->data->SetZWrap(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetZWrap(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetZWrap()?1L:0L);
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetUseWholeCollection(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the useWholeCollection in the object.
    obj->data->SetUseWholeCollection(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetUseWholeCollection(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetUseWholeCollection()?1L:0L);
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetCategoryName(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged as first member of a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyUnicode_Check(packaged_args))
            args = packaged_args;
    }

    if (!PyUnicode_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a unicode string");
    }

    char const *val = PyUnicode_AsUTF8(args);
    std::string cval = std::string(val);

    if (val == 0 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as utf8 string");
    }

    Py_XDECREF(packaged_args);

    // Set the categoryName in the object.
    obj->data->SetCategoryName(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetCategoryName(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyString_FromString(obj->data->GetCategoryName().c_str());
    return retval;
}

/*static*/ PyObject *
IndexSelectAttributes_SetSubsetName(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged as first member of a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyUnicode_Check(packaged_args))
            args = packaged_args;
    }

    if (!PyUnicode_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a unicode string");
    }

    char const *val = PyUnicode_AsUTF8(args);
    std::string cval = std::string(val);

    if (val == 0 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as utf8 string");
    }

    Py_XDECREF(packaged_args);

    // Set the subsetName in the object.
    obj->data->SetSubsetName(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
IndexSelectAttributes_GetSubsetName(PyObject *self, PyObject *args)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)self;
    PyObject *retval = PyString_FromString(obj->data->GetSubsetName().c_str());
    return retval;
}



PyMethodDef PyIndexSelectAttributes_methods[INDEXSELECTATTRIBUTES_NMETH] = {
    {"Notify", IndexSelectAttributes_Notify, METH_VARARGS},
    {"SetMaxDim", IndexSelectAttributes_SetMaxDim, METH_VARARGS},
    {"GetMaxDim", IndexSelectAttributes_GetMaxDim, METH_VARARGS},
    {"SetDim", IndexSelectAttributes_SetDim, METH_VARARGS},
    {"GetDim", IndexSelectAttributes_GetDim, METH_VARARGS},
    {"SetXAbsMax", IndexSelectAttributes_SetXAbsMax, METH_VARARGS},
    {"GetXAbsMax", IndexSelectAttributes_GetXAbsMax, METH_VARARGS},
    {"SetXMin", IndexSelectAttributes_SetXMin, METH_VARARGS},
    {"GetXMin", IndexSelectAttributes_GetXMin, METH_VARARGS},
    {"SetXMax", IndexSelectAttributes_SetXMax, METH_VARARGS},
    {"GetXMax", IndexSelectAttributes_GetXMax, METH_VARARGS},
    {"SetXIncr", IndexSelectAttributes_SetXIncr, METH_VARARGS},
    {"GetXIncr", IndexSelectAttributes_GetXIncr, METH_VARARGS},
    {"SetXWrap", IndexSelectAttributes_SetXWrap, METH_VARARGS},
    {"GetXWrap", IndexSelectAttributes_GetXWrap, METH_VARARGS},
    {"SetYAbsMax", IndexSelectAttributes_SetYAbsMax, METH_VARARGS},
    {"GetYAbsMax", IndexSelectAttributes_GetYAbsMax, METH_VARARGS},
    {"SetYMin", IndexSelectAttributes_SetYMin, METH_VARARGS},
    {"GetYMin", IndexSelectAttributes_GetYMin, METH_VARARGS},
    {"SetYMax", IndexSelectAttributes_SetYMax, METH_VARARGS},
    {"GetYMax", IndexSelectAttributes_GetYMax, METH_VARARGS},
    {"SetYIncr", IndexSelectAttributes_SetYIncr, METH_VARARGS},
    {"GetYIncr", IndexSelectAttributes_GetYIncr, METH_VARARGS},
    {"SetYWrap", IndexSelectAttributes_SetYWrap, METH_VARARGS},
    {"GetYWrap", IndexSelectAttributes_GetYWrap, METH_VARARGS},
    {"SetZAbsMax", IndexSelectAttributes_SetZAbsMax, METH_VARARGS},
    {"GetZAbsMax", IndexSelectAttributes_GetZAbsMax, METH_VARARGS},
    {"SetZMin", IndexSelectAttributes_SetZMin, METH_VARARGS},
    {"GetZMin", IndexSelectAttributes_GetZMin, METH_VARARGS},
    {"SetZMax", IndexSelectAttributes_SetZMax, METH_VARARGS},
    {"GetZMax", IndexSelectAttributes_GetZMax, METH_VARARGS},
    {"SetZIncr", IndexSelectAttributes_SetZIncr, METH_VARARGS},
    {"GetZIncr", IndexSelectAttributes_GetZIncr, METH_VARARGS},
    {"SetZWrap", IndexSelectAttributes_SetZWrap, METH_VARARGS},
    {"GetZWrap", IndexSelectAttributes_GetZWrap, METH_VARARGS},
    {"SetUseWholeCollection", IndexSelectAttributes_SetUseWholeCollection, METH_VARARGS},
    {"GetUseWholeCollection", IndexSelectAttributes_GetUseWholeCollection, METH_VARARGS},
    {"SetCategoryName", IndexSelectAttributes_SetCategoryName, METH_VARARGS},
    {"GetCategoryName", IndexSelectAttributes_GetCategoryName, METH_VARARGS},
    {"SetSubsetName", IndexSelectAttributes_SetSubsetName, METH_VARARGS},
    {"GetSubsetName", IndexSelectAttributes_GetSubsetName, METH_VARARGS},
    {NULL, NULL}
};

//
// Type functions
//

static void
IndexSelectAttributes_dealloc(PyObject *v)
{
   IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)v;
   if(obj->parent != 0)
       Py_DECREF(obj->parent);
   if(obj->owns)
       delete obj->data;
}

static PyObject *IndexSelectAttributes_richcompare(PyObject *self, PyObject *other, int op);
PyObject *
PyIndexSelectAttributes_getattr(PyObject *self, char *name)
{
    if(strcmp(name, "maxDim") == 0)
        return IndexSelectAttributes_GetMaxDim(self, NULL);
    if(strcmp(name, "OneD") == 0)
        return PyInt_FromLong(long(IndexSelectAttributes::OneD));
    if(strcmp(name, "TwoD") == 0)
        return PyInt_FromLong(long(IndexSelectAttributes::TwoD));
    if(strcmp(name, "ThreeD") == 0)
        return PyInt_FromLong(long(IndexSelectAttributes::ThreeD));

    if(strcmp(name, "dim") == 0)
        return IndexSelectAttributes_GetDim(self, NULL);
    if(strcmp(name, "OneD") == 0)
        return PyInt_FromLong(long(IndexSelectAttributes::OneD));
    if(strcmp(name, "TwoD") == 0)
        return PyInt_FromLong(long(IndexSelectAttributes::TwoD));
    if(strcmp(name, "ThreeD") == 0)
        return PyInt_FromLong(long(IndexSelectAttributes::ThreeD));

    if(strcmp(name, "xAbsMax") == 0)
        return IndexSelectAttributes_GetXAbsMax(self, NULL);
    if(strcmp(name, "xMin") == 0)
        return IndexSelectAttributes_GetXMin(self, NULL);
    if(strcmp(name, "xMax") == 0)
        return IndexSelectAttributes_GetXMax(self, NULL);
    if(strcmp(name, "xIncr") == 0)
        return IndexSelectAttributes_GetXIncr(self, NULL);
    if(strcmp(name, "xWrap") == 0)
        return IndexSelectAttributes_GetXWrap(self, NULL);
    if(strcmp(name, "yAbsMax") == 0)
        return IndexSelectAttributes_GetYAbsMax(self, NULL);
    if(strcmp(name, "yMin") == 0)
        return IndexSelectAttributes_GetYMin(self, NULL);
    if(strcmp(name, "yMax") == 0)
        return IndexSelectAttributes_GetYMax(self, NULL);
    if(strcmp(name, "yIncr") == 0)
        return IndexSelectAttributes_GetYIncr(self, NULL);
    if(strcmp(name, "yWrap") == 0)
        return IndexSelectAttributes_GetYWrap(self, NULL);
    if(strcmp(name, "zAbsMax") == 0)
        return IndexSelectAttributes_GetZAbsMax(self, NULL);
    if(strcmp(name, "zMin") == 0)
        return IndexSelectAttributes_GetZMin(self, NULL);
    if(strcmp(name, "zMax") == 0)
        return IndexSelectAttributes_GetZMax(self, NULL);
    if(strcmp(name, "zIncr") == 0)
        return IndexSelectAttributes_GetZIncr(self, NULL);
    if(strcmp(name, "zWrap") == 0)
        return IndexSelectAttributes_GetZWrap(self, NULL);
    if(strcmp(name, "useWholeCollection") == 0)
        return IndexSelectAttributes_GetUseWholeCollection(self, NULL);
    if(strcmp(name, "categoryName") == 0)
        return IndexSelectAttributes_GetCategoryName(self, NULL);
    if(strcmp(name, "subsetName") == 0)
        return IndexSelectAttributes_GetSubsetName(self, NULL);


    // Add a __dict__ answer so that dir() works
    if (!strcmp(name, "__dict__"))
    {
        PyObject *result = PyDict_New();
        for (int i = 0; PyIndexSelectAttributes_methods[i].ml_meth; i++)
            PyDict_SetItem(result,
                PyString_FromString(PyIndexSelectAttributes_methods[i].ml_name),
                PyString_FromString(PyIndexSelectAttributes_methods[i].ml_name));
        return result;
    }

    return Py_FindMethod(PyIndexSelectAttributes_methods, self, name);
}

int
PyIndexSelectAttributes_setattr(PyObject *self, char *name, PyObject *args)
{
    PyObject NULL_PY_OBJ;
    PyObject *obj = &NULL_PY_OBJ;

    if(strcmp(name, "maxDim") == 0)
        obj = IndexSelectAttributes_SetMaxDim(self, args);
    else if(strcmp(name, "dim") == 0)
        obj = IndexSelectAttributes_SetDim(self, args);
    else if(strcmp(name, "xAbsMax") == 0)
        obj = IndexSelectAttributes_SetXAbsMax(self, args);
    else if(strcmp(name, "xMin") == 0)
        obj = IndexSelectAttributes_SetXMin(self, args);
    else if(strcmp(name, "xMax") == 0)
        obj = IndexSelectAttributes_SetXMax(self, args);
    else if(strcmp(name, "xIncr") == 0)
        obj = IndexSelectAttributes_SetXIncr(self, args);
    else if(strcmp(name, "xWrap") == 0)
        obj = IndexSelectAttributes_SetXWrap(self, args);
    else if(strcmp(name, "yAbsMax") == 0)
        obj = IndexSelectAttributes_SetYAbsMax(self, args);
    else if(strcmp(name, "yMin") == 0)
        obj = IndexSelectAttributes_SetYMin(self, args);
    else if(strcmp(name, "yMax") == 0)
        obj = IndexSelectAttributes_SetYMax(self, args);
    else if(strcmp(name, "yIncr") == 0)
        obj = IndexSelectAttributes_SetYIncr(self, args);
    else if(strcmp(name, "yWrap") == 0)
        obj = IndexSelectAttributes_SetYWrap(self, args);
    else if(strcmp(name, "zAbsMax") == 0)
        obj = IndexSelectAttributes_SetZAbsMax(self, args);
    else if(strcmp(name, "zMin") == 0)
        obj = IndexSelectAttributes_SetZMin(self, args);
    else if(strcmp(name, "zMax") == 0)
        obj = IndexSelectAttributes_SetZMax(self, args);
    else if(strcmp(name, "zIncr") == 0)
        obj = IndexSelectAttributes_SetZIncr(self, args);
    else if(strcmp(name, "zWrap") == 0)
        obj = IndexSelectAttributes_SetZWrap(self, args);
    else if(strcmp(name, "useWholeCollection") == 0)
        obj = IndexSelectAttributes_SetUseWholeCollection(self, args);
    else if(strcmp(name, "categoryName") == 0)
        obj = IndexSelectAttributes_SetCategoryName(self, args);
    else if(strcmp(name, "subsetName") == 0)
        obj = IndexSelectAttributes_SetSubsetName(self, args);

    if (obj != NULL && obj != &NULL_PY_OBJ)
        Py_DECREF(obj);

    if (obj == &NULL_PY_OBJ)
    {
        obj = NULL;
        PyErr_Format(PyExc_NameError, "name '%s' is not defined", name);
    }
    else if (obj == NULL && !PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "unknown problem with '%s'", name);

    return (obj != NULL) ? 0 : -1;
}

static int
IndexSelectAttributes_print(PyObject *v, FILE *fp, int flags)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)v;
    fprintf(fp, "%s", PyIndexSelectAttributes_ToString(obj->data, "",false).c_str());
    return 0;
}

PyObject *
IndexSelectAttributes_str(PyObject *v)
{
    IndexSelectAttributesObject *obj = (IndexSelectAttributesObject *)v;
    return PyString_FromString(PyIndexSelectAttributes_ToString(obj->data,"", false).c_str());
}

//
// The doc string for the class.
//
#if PY_MAJOR_VERSION > 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 5)
static const char *IndexSelectAttributes_Purpose = "This class contains attributes for the index select operator.";
#else
static char *IndexSelectAttributes_Purpose = "This class contains attributes for the index select operator.";
#endif

//
// Python Type Struct Def Macro from Py2and3Support.h
//
//         VISIT_PY_TYPE_OBJ( VPY_TYPE,
//                            VPY_NAME,
//                            VPY_OBJECT,
//                            VPY_DEALLOC,
//                            VPY_PRINT,
//                            VPY_GETATTR,
//                            VPY_SETATTR,
//                            VPY_STR,
//                            VPY_PURPOSE,
//                            VPY_RICHCOMP,
//                            VPY_AS_NUMBER)

//
// The type description structure
//

VISIT_PY_TYPE_OBJ(IndexSelectAttributesType,         \
                  "IndexSelectAttributes",           \
                  IndexSelectAttributesObject,       \
                  IndexSelectAttributes_dealloc,     \
                  IndexSelectAttributes_print,       \
                  PyIndexSelectAttributes_getattr,   \
                  PyIndexSelectAttributes_setattr,   \
                  IndexSelectAttributes_str,         \
                  IndexSelectAttributes_Purpose,     \
                  IndexSelectAttributes_richcompare, \
                  0); /* as_number*/

//
// Helper function for comparing.
//
static PyObject *
IndexSelectAttributes_richcompare(PyObject *self, PyObject *other, int op)
{
    // only compare against the same type 
    if ( Py_TYPE(self) != &IndexSelectAttributesType
         || Py_TYPE(other) != &IndexSelectAttributesType)
    {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }

    PyObject *res = NULL;
    IndexSelectAttributes *a = ((IndexSelectAttributesObject *)self)->data;
    IndexSelectAttributes *b = ((IndexSelectAttributesObject *)other)->data;

    switch (op)
    {
       case Py_EQ:
           res = (*a == *b) ? Py_True : Py_False;
           break;
       case Py_NE:
           res = (*a != *b) ? Py_True : Py_False;
           break;
       default:
           res = Py_NotImplemented;
           break;
    }

    Py_INCREF(res);
    return res;
}

//
// Helper functions for object allocation.
//

static IndexSelectAttributes *defaultAtts = 0;
static IndexSelectAttributes *currentAtts = 0;

static PyObject *
NewIndexSelectAttributes(int useCurrent)
{
    IndexSelectAttributesObject *newObject;
    newObject = PyObject_NEW(IndexSelectAttributesObject, &IndexSelectAttributesType);
    if(newObject == NULL)
        return NULL;
    if(useCurrent && currentAtts != 0)
        newObject->data = new IndexSelectAttributes(*currentAtts);
    else if(defaultAtts != 0)
        newObject->data = new IndexSelectAttributes(*defaultAtts);
    else
        newObject->data = new IndexSelectAttributes;
    newObject->owns = true;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

static PyObject *
WrapIndexSelectAttributes(const IndexSelectAttributes *attr)
{
    IndexSelectAttributesObject *newObject;
    newObject = PyObject_NEW(IndexSelectAttributesObject, &IndexSelectAttributesType);
    if(newObject == NULL)
        return NULL;
    newObject->data = (IndexSelectAttributes *)attr;
    newObject->owns = false;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

///////////////////////////////////////////////////////////////////////////////
//
// Interface that is exposed to the VisIt module.
//
///////////////////////////////////////////////////////////////////////////////

PyObject *
IndexSelectAttributes_new(PyObject *self, PyObject *args)
{
    int useCurrent = 0;
    if (!PyArg_ParseTuple(args, "i", &useCurrent))
    {
        if (!PyArg_ParseTuple(args, ""))
            return NULL;
        else
            PyErr_Clear();
    }

    return (PyObject *)NewIndexSelectAttributes(useCurrent);
}

//
// Plugin method table. These methods are added to the visitmodule's methods.
//
static PyMethodDef IndexSelectAttributesMethods[] = {
    {"IndexSelectAttributes", IndexSelectAttributes_new, METH_VARARGS},
    {NULL,      NULL}        /* Sentinel */
};

static Observer *IndexSelectAttributesObserver = 0;

std::string
PyIndexSelectAttributes_GetLogString()
{
    std::string s("IndexSelectAtts = IndexSelectAttributes()\n");
    if(currentAtts != 0)
        s += PyIndexSelectAttributes_ToString(currentAtts, "IndexSelectAtts.", true);
    return s;
}

static void
PyIndexSelectAttributes_CallLogRoutine(Subject *subj, void *data)
{
    typedef void (*logCallback)(const std::string &);
    logCallback cb = (logCallback)data;

    if(cb != 0)
    {
        std::string s("IndexSelectAtts = IndexSelectAttributes()\n");
        s += PyIndexSelectAttributes_ToString(currentAtts, "IndexSelectAtts.", true);
        cb(s);
    }
}

void
PyIndexSelectAttributes_StartUp(IndexSelectAttributes *subj, void *data)
{
    if(subj == 0)
        return;

    currentAtts = subj;
    PyIndexSelectAttributes_SetDefaults(subj);

    //
    // Create the observer that will be notified when the attributes change.
    //
    if(IndexSelectAttributesObserver == 0)
    {
        IndexSelectAttributesObserver = new ObserverToCallback(subj,
            PyIndexSelectAttributes_CallLogRoutine, (void *)data);
    }

}

void
PyIndexSelectAttributes_CloseDown()
{
    delete defaultAtts;
    defaultAtts = 0;
    delete IndexSelectAttributesObserver;
    IndexSelectAttributesObserver = 0;
}

PyMethodDef *
PyIndexSelectAttributes_GetMethodTable(int *nMethods)
{
    *nMethods = 1;
    return IndexSelectAttributesMethods;
}

bool
PyIndexSelectAttributes_Check(PyObject *obj)
{
    return (obj->ob_type == &IndexSelectAttributesType);
}

IndexSelectAttributes *
PyIndexSelectAttributes_FromPyObject(PyObject *obj)
{
    IndexSelectAttributesObject *obj2 = (IndexSelectAttributesObject *)obj;
    return obj2->data;
}

PyObject *
PyIndexSelectAttributes_New()
{
    return NewIndexSelectAttributes(0);
}

PyObject *
PyIndexSelectAttributes_Wrap(const IndexSelectAttributes *attr)
{
    return WrapIndexSelectAttributes(attr);
}

void
PyIndexSelectAttributes_SetParent(PyObject *obj, PyObject *parent)
{
    IndexSelectAttributesObject *obj2 = (IndexSelectAttributesObject *)obj;
    obj2->parent = parent;
}

void
PyIndexSelectAttributes_SetDefaults(const IndexSelectAttributes *atts)
{
    if(defaultAtts)
        delete defaultAtts;

    defaultAtts = new IndexSelectAttributes(*atts);
}

